<template>
	<div v-if="column?.prop && row">
    <PointStatus v-if="type =='PointStatus'" :value="row[column.prop]" :options="column.dicData"></PointStatus>
		<DictTags
			v-else-if="column.code || column.dicData"
			:code="column.code"
			:options="column.dicData"
			:column="column"
			:row="row"
			:value="row[column.prop]"
			:key="reloadKey"
		/>
		<UserCard v-else-if="type =='UserCard'" :row="row" :column="column"></UserCard>
		<template v-else>
			<FileList :value="fileUrl" :item="{ label: column.label }" :single="!column.showFileList" imgSize="36"></FileList>
		</template>
	</div>
</template>

<script setup lang="ts">
import FileList from '@/views/aplid/DetailPage/ContentListItem/FileList/index.vue'
import DictTags from './DictTags/home'
import PointStatus from './PointStatus/index.vue'
import UserCard from './UserCard/index.vue'

type Props = {
	row?: any
	column?: any
	type?: string
}
const props = withDefaults(defineProps<Props>(), {})
const fileUrl = ref(props.row[props.column.prop])
const reloadKey = ref(0)
watch(
	() => props.row,
	(val) => {
		reloadKey.value = Math.random()
		fileUrl.value = val ? val[props.column.prop] : ''
	},
	{
		immediate: true,
		deep: true,
	}
)
</script>

<style scoped></style>
